
CC = g++
LIBXML2 = $(shell pkg-config --libs --cflags libxml-2.0)
CFLAGS = -O2 -Wall -g -I . -I ../inc -I ../../../src/XMLInterface/ $(LIBXML2)


# This flag includes the Pthreads library on a Linux box.
# Others systems will probably require something different.
LIB = -lpthread
LIB += -lrt -lxml2 -lm
XML_UTILS=../../../src/

all: tiny_mps

tiny_mps: tiny_mps.cpp csapp.o sbuf.o ads_mgr.cpp $(XML_UTILS)/XMLInterface/xmlInterface.cpp $(XML_UTILS)/XMLInterface/xml_utils.cpp
	$(CC) $(CFLAGS) -o tiny_multi_thread    ads_mgr.cpp tiny_mps.cpp csapp.o sbuf.o $(XML_UTILS)XMLInterface/xmlInterface.cpp\
	 $(XML_UTILS)/XMLInterface/xml_utils.cpp $(LIB) 
csapp.o:
	$(CC) $(CFLAGS) -c csapp.c
sbuf.o :
	$(CC) -c $(CFLAGS) sbuf.c 
clean:
	rm -f *.o tiny *~ core
